<template>
	<view class="content-box">
		<view class="content-box-top-bb">
			<view class="tk_test_01">
				<view class="t01">题库练习</view>
				<view class="t02" >拥有海量考试练习题</view>
			</view>
			<view style="width: 50%;float: left;margin-top: 100rpx;">
				<image src="../../static/training/tk.png" style="width: 320rpx;margin-left: 10%;" mode="widthFix"></image>
			</view>
		</view>
		<view class="back_btn_box">
			<image src="../../static/training/back.png" style="width: 20rpx;" mode="widthFix" @click="back"></image>
		</view>
		
		<view v-for="(item,index) in list" :key="index" class="tk_item" @click="question_start(item)">
			<view class="title">{{item.bank_name}}</view>
			<view class="info">
				本题库{{item.num}}道/<text>暂未有更新</text>
				<view class="gobtn">去练习</view>
			</view>
		</view> 
		<!--<view class="tk_item">
			<view class="title">题库名称题库名称题库名称题库名称题库名称题库名称题库名称题库名称</view>
			<view class="info">
				本题库300道/<text class="update">更新10道</text>
				<view class="gobtn">去练习</view>
			</view>
		</view> -->
	</view>
</template>

<script>
	import {
		getInfo
	} from "@/common/api/login/login.js";
	import {
		getQuestBankList
	} from "@/common/api/training/training.js";
	export default {
		data() {
			return { 
				list:[]
			};
		},
		onLoad() {
			getQuestBankList().then((res) => {
				  if (res && res.code == 200 && res.data) { 
						this.list = res.data;
				  }
			});
		},
		methods: {
			back(){
				uni.navigateBack()
			},
			question_start(item){
				console.log(item)
				uni.navigateTo({
					url:"/pages/training/question_start?id="+item.id
				})
			},
			scantron(){
				uni.navigateTo({
					url:"/pages/training/scantron"
				})
			}, 
		},
	};
</script>

<style lang="scss" scoped>
	@import url("../../common/base.css");
	@import url("./topic.scss");
	page {
		background-color: #F2F3F6;
	}
	
</style>